home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume15 / tpscript / part03 < prev    next >
Encoding:
Internet Message Format  |  1988-05-25  |  48.1 KB

  1. Subject:  v15i015:  Ditroff to PostScript translator, Part03/05
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Axel Mahler <axel%coma.UUCP%TUB.BITNET@mitvma.mit.edu>
  7. Posting-number: Volume 15, Issue 15
  8. Archive-name: tpscript/part03
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 3 (of 5)."
  17. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  18. if test -f './READ_ME' -a "${1}" != "-c" ; then 
  19.   echo shar: Will not clobber existing file \"'./READ_ME'\"
  20. else
  21. echo shar: Extracting \"'./READ_ME'\" \(5305 characters\)
  22. sed "s/^X//" >'./READ_ME' <<'END_OF_FILE'
  23. Copyright:    1985, Stephen Frede, UNSW Australia
  24. X    Use it and copy it as much as you want, but don't pretend you
  25. X    wrote it, or sell it for profit.
  26. X
  27. Authorship:    Originally by Stephen Frede.
  28. X        Various extensive changes by
  29. X            Cameron Davidson and Michael Rourke.
  30. X        GEM support added and reliability of PostScript output
  31. X        improved by Axel Mahler and Andreas Lampen.
  32. X        (axel@coma.uucp/andy@coma.uucp).
  33. X
  34. Contents:
  35. X    0) File 'READ_ME', directories 'src', 'src/tpscript',
  36. X        'src/opscript', 'src/pscript', 'man', 'devalw'
  37. X
  38. X    1) Source for a back end to ditroff which converts ditroff
  39. X       output to PostScript (src/tpscript).
  40. X
  41. X    2) Font code and width tables suitable for use with ditroff (devalw).
  42. X
  43. X    3) A program (lpscript) which converts plain text into postscript.
  44. X       various options allow selection of font, size and rotation, etc.
  45. X
  46. X    4) A program (ipscript) which converts bitmap images of various sorts
  47. X       into postscript.
  48. X
  49. X    5) Manual entries for lpscript and ipscript.
  50. X
  51. X    6) The directory src/pscript contains some random postscript
  52. X       programs that may or may not be useful.
  53. X
  54. X
  55. NOTES:
  56. X    The sources should be pretty much bug free. They have been run on
  57. X    a few different systems, but I have no doubt that upon releasing it
  58. X    to the world, some will come to light. Please mail suggestions
  59. X    and fixes directly to me at the address given above.
  60. X
  61. X    The troff names for many of the characters were taken from a paper
  62. X    about such things from:
  63. X        "Adventures with Typesetter Independent Troff", by
  64. X    Mark Kahrs and Lee Moore, Dept. Computer Science, University
  65. X    of Rochester, Rochester, NY 14627. TR159; June, 1985.
  66. X
  67. X    Work is in progress to allow down-line loading of fonts other than
  68. X    those available by default in the LaserWriter (or whatever), such
  69. X    as the Berkeley fonts.
  70. X
  71. X    They have never been run on anything other than a LaserWriter, but
  72. X    I don't know of any inherent machine dependencies (other than those
  73. X    indicated by "#if ALW").
  74. X
  75. X    There are some further changes made by Cameron Davidson to fine tune
  76. X    some problems with rounding to pixel boundaries on the LaserWriter
  77. X    that are not included in this release.
  78. X
  79. X    There are two basica possible approaches to generating postscript
  80. X    from some other format. The first is to generate a postscript
  81. X    program which then reads input and does the conversion itself.
  82. X    The alternative is to do as much of the translation as possible
  83. X    first, generating relatively simple postscript commands. This
  84. X    is the way these programs work. I have not seen Transcript, by
  85. X    Adobe Systems, but I suspect they do it the first way.
  86. X
  87. X    Add an entry to the "magic" file that the file(1) command uses
  88. X    to look for the characters "%!" at the start of a file.
  89. X    This indicates that a file is "PostScript".
  90. X
  91. Installation:
  92. X    First you must have ditroff, a device independant troff from ATT,
  93. X    requiring a licence. This most usually comes with Documenter's
  94. X    WorkBench (DWB). This should include the program "makedev", used
  95. X    to "compile" the ascii font tables into binary, so that troff and
  96. X    tpscript can read them.
  97. X
  98. X    Put all of this stuff into a directory somewhere.
  99. X    Edit the Makefile in the top directory and set SYS= one of the
  100. X    systems indicated there (AUSAM, V7, SYS5, BSD).
  101. X    Then set VERBOSE=1 if you want some needless extra frills. This
  102. X    is mainly just identifying jobs by username, etc.
  103. X    Set MAKEDEV to be the pathname of the makedev program (in the
  104. X    troff source directory ?).
  105. X    Then compile it all by saying "make" in the top directory.
  106. X    This should generate tpscript, ipscript and lpscript.
  107. X    Install them manually in whatever way is appropriate for your system.
  108. X    Possibly change the Makefiles to do this. Also note that the
  109. X    Makefiles will not do anything smart about .o files or anything
  110. X    like that.
  111. X    We have installed the real troff in /bin/ditroff and made troff a
  112. X    shell script that invokes the appropriate back end. The shell script
  113. X    is included here as src/troff.sh, use it if you want.
  114. X    Install the manual entries for ipscript and lpscript (from the man
  115. X    directory).
  116. X
  117. Possible problems:
  118. X    First read the problems section in "Inside LaserWriter".
  119. X    Note the various patches from Adobe that have come over USENET.
  120. X
  121. X    On some versions of Unix, if the LaserWriter is connected to
  122. X    a tty port, and a daemon of some sort continually sends stuff to
  123. X    the LaserWriter, but never reads anything, and the LaserWriter
  124. X    sends messages back (which aren't read by anyone), then when
  125. X    the total number of unread characters reaches a certain amount
  126. X    (TTYHOG, 256 or 512 usually), both the input AND output queues
  127. X    are flushed, so some characters to the LaserWriter get dropped,
  128. X    probably causing a syntax error and the rest of the job to be
  129. X    flushed. A good thing to do (even if you don't have this problem)
  130. X    is to collect all the output from that line and save it in a file.
  131. X    This makes looking at error and other messages from the LaserWriter
  132. X    quite easy (tail /tmp/laserout). On BSD machines one may e.g. add
  133. X    a line "/usr/ucb/tail +0cf /dev/ttyLW > /usr/spool/lpd/lw/lw-log &"
  134. X    to /etc/rc.local.
  135. X
  136. X    Note a bug in many versions of eqn(1) which causes a right large
  137. X    square bracket to be made of '|' characters instead of "\(bv" chars.
  138. X    If you have the source, this is easy to fix.
  139. X
  140. X    I don't know what some of the Berkeley ditroff output means.
  141. X    If someone would like to fill me in, I'll add it to tpscript.
  142. END_OF_FILE
  143. if test 5305 -ne `wc -c <'./READ_ME'`; then
  144.     echo shar: \"'./READ_ME'\" unpacked with wrong size!
  145. fi
  146. # end of './READ_ME'
  147. fi
  148. if test -f './man/ipscript.1' -a "${1}" != "-c" ; then 
  149.   echo shar: Will not clobber existing file \"'./man/ipscript.1'\"
  150. else
  151. echo shar: Extracting \"'./man/ipscript.1'\" \(3990 characters\)
  152. sed "s/^X//" >'./man/ipscript.1' <<'END_OF_FILE'
  153. X.TH IPSCRIPT 1
  154. X.SH NAME
  155. ipscript \- convert bit image into postscript
  156. X.SH SYNOPSIS
  157. X.B ipscript
  158. X[option] ... [file] ...
  159. X.SH DESCRIPTION
  160. X.I Ipscript
  161. reads bit images from standard input (or files if specified) and produces
  162. postscript output, suitable for sending to any postscript device (such
  163. as an Apple Laserwriter) or for using with any program that expects
  164. postscript input (such as a postscript interpreter used to drive some
  165. other raster device).
  166. In the output, grey levels are represented by a halftoning technique,
  167. whereby a grid of halftone cells is produced from the input data.
  168. The default frequency of halftone cells is 60 per inch, and an angle of 45 degrees.
  169. X(Alterable using the
  170. X.B \-f
  171. and
  172. X.B \-p
  173. options.)
  174. The following options are understood:
  175. X.TP
  176. X.B \-wWidth
  177. The image produced will be the given width (in cm).
  178. This may be a real number.
  179. The default is 18 cm.
  180. X.TP
  181. X.B \-hHeight
  182. The image will be produced with the given height (in cm).
  183. This may be a real number.
  184. The default is 12cm.
  185. X.TP
  186. X.B \-aAspect
  187. The image will be produced with the given aspect ratio.
  188. The default aspect ratio is 1.5 (width/height).
  189. If both width and height are specified on the command line,
  190. the aspect ratio will be determined from these, rather than
  191. this argument.
  192. X.TP
  193. X.B \-bBits
  194. This argument controls the output resolution (ie the number of grey
  195. levels used).
  196. It may be any of 1, 2, 4, or 8 for 2, 4, 16 or 256 output grey
  197. levels respectively.
  198. The default is 8 bits.
  199. X.TP
  200. X.B \-gGrey
  201. This (signed integer) value can be used to offset the input grey level by
  202. a fixed amount.
  203. It can be used to brighten or darken images.
  204. X.TP
  205. X.B \-yScanlines
  206. This value determines the number of pixels along the Y axis of
  207. the input image.
  208. This is the number of scanlines of the input.
  209. The default is 256.
  210. X.TP
  211. X.B \-xScanlength
  212. This value is the number of pixels along the X axis of the input image.
  213. This is the length of an input scanline.
  214. The default is 256.
  215. X.TP
  216. X.B \-fFrequency
  217. This value determines the output frequency in halftone cells/inch.
  218. The default is device dependant, but is 60 for the Apple LaserWriter.
  219. X.TP
  220. X.B \-pAngle
  221. Specifies the angle (in degrees) at which the output halftone cell
  222. grid is rotated.
  223. The default is device dependant, but is 45 for the Apple LaserWriter.
  224. X.TP
  225. X.B \-iFormat
  226. This argument specifies the input format and resolution.
  227. It consists of a character ('b' or 'x') followed by a value.
  228. The character specifies the form of the input: whether input data
  229. is given in raw bytes or in hex notation.
  230. The following value gives the input greyscale resolution - the number
  231. of bits representing the image which may appear in the input.
  232. If hex input format is being used and the greyscale resolution is
  233. less than or equal to 4 bits, single hex bytes are read, otherwise pairs
  234. of hex bytes are read to achieve a resolution of up to 8 bits.
  235. The default is 'b8' - bytes with a possible value of from 0 to 255.
  236. Input is scaled using this information and the number of output
  237. grey levels (if necessary).
  238. X.TP
  239. X.B \-sSkip
  240. Directs \fIipscript\fP to skip the given no. of bytes at the start
  241. of the input file.
  242. This is useful for files which have headers at the beginning.
  243. XFor example, Macquarie Uni satellite photos have a 128 byte header.
  244. X.TP
  245. X.B \-r[angle]
  246. This argument specifies an image rotation in degrees.
  247. If '-r' is given with no value, 90 is assumed, which results in landscape
  248. mode being used (long axis of paper horizontal).
  249. The default is 0, which is portrait mode (long axis of paper vertical).
  250. X.TP
  251. X.B \-n
  252. Print the negative of the image. That is, reverse black and white.
  253. X.TP
  254. X.B \-S
  255. Use manual feed instead of feeding from the paper tray.
  256. X.TP
  257. X.B \-L
  258. Print using legal page type - 17.8 by 31.8 cm (7 by 12.5 inches) imageable
  259. region, centred
  260. on a 21.6 by 35.6 cm (8.5 by 14 inch) page.
  261. The default (letter) paper type uses a 20.3 by 26.7 cm (8 by 10.5 inch)
  262. imageable region, centred on a 21.6 by 27.9 cm (8.5 by 11 inch) page.
  263. X.SH SEE ALSO
  264. ditroff(1)
  265. X.SH AUTHOR
  266. Stephen Frede, UNSW, Australia
  267. END_OF_FILE
  268. if test 3990 -ne `wc -c <'./man/ipscript.1'`; then
  269.     echo shar: \"'./man/ipscript.1'\" unpacked with wrong size!
  270. fi
  271. # end of './man/ipscript.1'
  272. fi
  273. if test -f './man/lpscript.1' -a "${1}" != "-c" ; then 
  274.   echo shar: Will not clobber existing file \"'./man/lpscript.1'\"
  275. else
  276. echo shar: Extracting \"'./man/lpscript.1'\" \(3778 characters\)
  277. sed "s/^X//" >'./man/lpscript.1' <<'END_OF_FILE'
  278. X.TH LPSCRIPT 1
  279. X.SH NAME
  280. lpscript \- convert text to postscript
  281. X.SH SYNOPSIS
  282. X.B lpscript
  283. X[-o[offset]] [-r[rotation]] [-s[fontsize]] [-f[font]]
  284. X[-p[pitch]] [-t[tabsize]] [-h[horizontal_spacing]] [-S] [-L] [file ...]
  285. X.SH DESCRIPTION
  286. X.I Lpscript
  287. reads text from standard input (or files if specified) and produces
  288. postscript output, suitable for sending to any postscript device (such
  289. as an Apple Laserwriter) or for using with any program that expects
  290. postscript input (such as a postscript interpreter used to drive some
  291. other raster device).
  292. Text is normally aligned at the top and left with the imageable region
  293. of the page (probably slightly smaller than the physical page size),
  294. and a new page is taken whenever text would fall below this imageable
  295. region.
  296. The following options are understood, with all values able to be given
  297. as integer or real:
  298. X.TP
  299. X.B \-o[distance]
  300. Offset the text from the left edge of the imageable region, by the given
  301. distance (in centimeters).
  302. If \fB-o\fP is specified without a distance, 1 cm is assumed.
  303. X.TP
  304. X.B \-r[angle]
  305. Rotate the page by the given angle, specified in degrees.
  306. If no angle is specified, 90 degrees is assumed.
  307. Normally, the page will be printed in portrait mode, ie with the
  308. long axis vertical.
  309. This option allows printing in landscape mode
  310. X(with the long axis horizontal).
  311. Note that specifying an angle other than 0 or 90 will almost
  312. certainly cause part of the text to fall outside the imageable region,
  313. which serves you right for trying to be silly.
  314. X.TP
  315. X.B \-s[size]
  316. Set the font size to the value given (in points) (72 points = 1 inch).
  317. If a size is omitted, 12 is assumed.
  318. The default point size without using this option is 10.
  319. Specifying point sizes greater than 200 is probably silly and
  320. certainly wastes toner.
  321. X.TP
  322. X.B \-t[tabsize]
  323. Set the tab size to the value given (in characters).
  324. If a value is omitted, 4 is assumed (the default is 8).
  325. This option allows printing of program listings etc., to fit across
  326. the page.
  327. X.TP
  328. X.B \-p[pitch]
  329. Set the line spacing of printed text to this value.
  330. Giving a value here will cause the line spacing to be set to that
  331. value, in points (72 points = 1 inch).
  332. If this argument is given without a value, double spacing is selected.
  333. The default spacing is 0.
  334. X.TP
  335. X.B \-f[fontname]
  336. Set the font used to the name given.
  337. The default font is `Courier'.
  338. If this argument is given without a fontname, `Times-Roman' is used.
  339. The list of available fonts (for the Apple Laser-Writer) is: `Times-Roman'
  340. X; `Times-Italic'
  341. X; `Times-Bold'; `Times-BoldItalic'; `Courier'; `Courier-Oblique'
  342. X; `Courier-Bold'; `Courier-BoldOblique'; `Helvetica'; `Helvetica-Bold'
  343. X; `Helvetica-Oblique'; `Helvetica-BoldOblique'.
  344. Note that only the Courier family is a fixed-width font; all the others
  345. are variable width, and so program listings or columns of data will
  346. not line up.
  347. X.TP
  348. X.B \-h[space]
  349. Increase the horizontal spacing of characters by the given fraction of
  350. the current font size.
  351. XFor example, using `-h0.25' with a font size of 12 points in effect,
  352. would cause an increase of horizontal spacing by 3 points.
  353. By default, the characters are placed next to each other, using the
  354. natural width of the characters.
  355. Negative values (eg. -h-0.1) cause horizontal spacing to be decreased.
  356. X.TP
  357. X.B \-a[aspect-ratio]
  358. Set the aspect ratio (height:width) of each character to the given value
  359. X(default 1).
  360. X.TP
  361. X.B \-S
  362. Use manual feed instead of feeding from the paper tray.
  363. X.TP
  364. X.B \-L
  365. Print using legal page type - 17.8 by 31.8 cm (7 by 12.5 inches) imageable
  366. region, centred
  367. on a 21.6 by 35.6 cm (8.5 by 14 inch) page.
  368. The default (letter) paper type uses a 20.3 by 26.7 cm (8 by 10.5 inch)
  369. imageable region, centred on a 21.6 by 27.9 cm (8.5 by 11 inch) page.
  370. X.SH SEE ALSO
  371. ditroff(1)
  372. X.SH AUTHOR
  373. Stephen Frede, UNSW, Australia
  374. END_OF_FILE
  375. if test 3778 -ne `wc -c <'./man/lpscript.1'`; then
  376.     echo shar: \"'./man/lpscript.1'\" unpacked with wrong size!
  377. fi
  378. # end of './man/lpscript.1'
  379. fi
  380. if test -f './pscript/demo.ps' -a "${1}" != "-c" ; then 
  381.   echo shar: Will not clobber existing file \"'./pscript/demo.ps'\"
  382. else
  383. echo shar: Extracting \"'./pscript/demo.ps'\" \(4966 characters\)
  384. sed "s/^X//" >'./pscript/demo.ps' <<'END_OF_FILE'
  385. X%!
  386. X% a demo of lots of nifty things you can do on a LaserWriter
  387. X% - Stephen Frede
  388. X
  389. X(demo starting) print flush
  390. X/cm { 28.3465 mul } def
  391. X/ps { print flush } def
  392. X
  393. clippath pathbbox pop pop translate 10 10 translate
  394. clippath pathbbox /pgtop exch def /pgright exch def pop pop
  395. X
  396. X
  397. X% greyscale
  398. X
  399. X/width 1 cm def
  400. X/step 0.5 cm def
  401. X/greyscale {
  402. X    /left exch def
  403. X    0 step pgtop
  404. X    {
  405. X        /val exch def
  406. X        val pgtop div setgray
  407. X        newpath
  408. X        % draw a box
  409. X        left val moveto
  410. X        width 0 rlineto
  411. X        0 step rlineto
  412. X        0 width sub 0 rlineto
  413. X        closepath
  414. X        fill
  415. X    } for
  416. X    0 setgray
  417. X} def
  418. X
  419. X0 greyscale
  420. X
  421. X60 15 { dup mul exch dup mul add 1 exch sub } setscreen
  422. X1.5 cm greyscale
  423. X100 45 { dup mul exch dup mul add 1 exch sub } setscreen
  424. X3 cm greyscale
  425. X10 45 { dup mul exch dup mul add 1.0 exch sub } setscreen
  426. X4.5 cm greyscale
  427. X60 45 { dup mul exch dup mul add 1 exch sub } setscreen
  428. X
  429. X
  430. X6 cm 0 translate
  431. X
  432. X% available fonts
  433. X
  434. X/x 1 cm def /y pgtop 1 cm sub def
  435. X/s { show /y y 20 sub def } def
  436. X/m { x y moveto } def
  437. X/f { findfont 15 scalefont setfont } def
  438. X/fm { f m } def
  439. X/Times-Roman fm (Times Roman (R)) s
  440. X/Times-Bold fm (Times Bold (B)) s
  441. X/Times-Italic fm (Times Italic (I)) s
  442. X/Times-BoldItalic fm (Times Bold Italic (BI)) s
  443. X/Helvetica fm (Helvetica (H)) s
  444. X/Helvetica-Bold fm (Helvetica Bold (HB)) s
  445. X/Helvetica-Oblique fm (Helvetica Oblique (HO)) s
  446. X/Helvetica-BoldOblique fm (Helvetica Bold Oblique (HX)) s
  447. X/Courier fm (Courier (C)) s
  448. X/Courier-Bold fm (Courier Bold (CB)) s
  449. X/Courier-Oblique fm (Courier Oblique (CO)) s
  450. X/Courier-BoldOblique fm (Courier Bold Oblique (CX)) s
  451. X/Symbol fm (abcdefg ABCDEFG ) show /Times-Roman f ((S)) s
  452. X
  453. X% sizes
  454. X
  455. x 10 moveto
  456. X/currfont /Helvetica findfont def
  457. X/r { /txt exch def currfont exch scalefont setfont txt show } def
  458. X
  459. X3 (A) r
  460. X4 (B) r
  461. X6 (C) r
  462. X8 (D) r
  463. X10 (E) r
  464. X15 (F) r
  465. X20 (G) r
  466. X30 (H) r
  467. X50 (I) r
  468. X70 (J) r
  469. X
  470. X% white on black
  471. X
  472. X20 0 rmoveto
  473. currentpoint pop /x exch def
  474. x 0 moveto
  475. X0 80 rlineto x 0 rlineto 0 -80 rlineto closepath fill
  476. X/currfont /Times-Bold findfont def
  477. X1 setgray
  478. x 10 moveto
  479. X70 (K) r
  480. X50 (L) r
  481. X30 (M) r
  482. X20 (N) r
  483. X15 (O) r
  484. X10 (P) r
  485. X8 (Q) r
  486. X6 (R) r
  487. X4 (S) r
  488. X3 (T) r
  489. X
  490. X0 setgray
  491. X
  492. X% shadow
  493. X
  494. X/shadow
  495. X{
  496. X    /text exch def
  497. X    1 -0.1 -0.1
  498. X    {
  499. X        setgray -0.7 0.7 rmoveto
  500. X        currentpoint text show moveto
  501. X    } for
  502. X    0 setgray
  503. X} def
  504. X
  505. X/Times-Roman findfont 30 scalefont setfont
  506. X7 cm 26 cm moveto
  507. X(Shadow) shadow
  508. X
  509. gsave
  510. X/Times-Italic findfont 30 scalefont setfont
  511. X/printzip
  512. X{ 0 0 moveto (Zip) show } def
  513. X12 cm 26 cm translate
  514. X.95 -.05 0 { setgray printzip -1 .5 translate} for
  515. X1 setgray printzip
  516. grestore
  517. X
  518. X% outline
  519. X8 cm 25 cm moveto
  520. X
  521. X/makeoutlinedict 5 dict def
  522. makeoutlinedict begin
  523. X/basefontdict /Times-Roman findfont def
  524. X/outfontdict basefontdict maxlength 1 add dict def
  525. basefontdict
  526. X{
  527. X    exch dup /FID ne
  528. X    { exch outfontdict 3 1 roll put }
  529. X    { pop pop }
  530. X    ifelse
  531. X} forall
  532. outfontdict /FontName /Times_Out put
  533. outfontdict /PaintType 2 put
  534. outfontdict /StrokeWidth 3 put
  535. X/Times_Out outfontdict definefont pop end
  536. X/Times_Out findfont 30 scalefont setfont
  537. X
  538. X(Outline) show
  539. X
  540. X% ellipse
  541. X
  542. X/ellipsedict 8 dict def ellipsedict /mtrx matrix put
  543. X/ellipse {
  544. X    ellipsedict begin
  545. X    /yrad exch def /xrad exch def /y exch def /x exch def
  546. X    /savematrix mtrx currentmatrix def
  547. X    x y translate xrad yrad scale
  548. X    newpath 0 0 1 0 360 arc
  549. X    savematrix setmatrix
  550. X    end
  551. X} def
  552. X
  553. X% Star Lines
  554. X
  555. X/Times-BoldItalic findfont 27 scalefont setfont
  556. X/rays {
  557. X    0 1.5 179
  558. X    { gsave
  559. X        rotate 0 0 moveto 108 0 lineto stroke grestore
  560. X    } for
  561. X} def
  562. X
  563. gsave
  564. X10 cm 15 cm moveto
  565. X(StarLines) true charpath clip
  566. newpath 54 -15 translate rays
  567. grestore
  568. X
  569. X% circle laser
  570. X/Helvetica-Bold findfont 30 scalefont setfont
  571. X/oshow    % stack: (string)
  572. X{ true charpath stroke } def
  573. X/circleofAdobe
  574. X{
  575. X    15 15 345
  576. X    {
  577. X        gsave rotate 0 0 moveto (Adobe) oshow grestore
  578. X    } for
  579. X} def
  580. gsave
  581. X4 cm 10 cm translate
  582. X0.5 setlinewidth
  583. circleofAdobe
  584. X0 0 moveto (Adobe Systems) true charpath gsave 1 setgray fill grestore stroke
  585. grestore
  586. X
  587. X% star lines
  588. X/Times-BoldItalic findfont 2 cm scalefont setfont
  589. X/rays
  590. X  { 0 1.5 179
  591. X    { gsave rotate 0 0 moveto 5 cm 0 lineto stroke grestore } for
  592. X} def
  593. gsave
  594. X1 cm 3.5 cm translate
  595. X.25 setlinewidth
  596. newpath 0 0 moveto (StarLines) true charpath clip
  597. newpath 3.9 cm -0.5 cm translate rays
  598. grestore
  599. X
  600. X
  601. X% pattern
  602. X
  603. X/bitison
  604. X{
  605. X    /ybit exch def /xbit exch def
  606. X    bstring ybit bwidth mul
  607. X    xbit 8 idiv add get
  608. X    1 7 xbit 8 mod sub bitshift
  609. X    and 0 ne
  610. X} def
  611. X
  612. X/setpattern
  613. X{
  614. X    /freq exch def
  615. X    /bwidth exch def
  616. X    /bpside exch def
  617. X    /bstring exch def
  618. X    /onbits 0 def /offbits 0 def
  619. X    freq 0 {
  620. X        /y exch def /x exch def
  621. X        /xindex x 1 add 2 div bpside mul cvi def
  622. X        /yindex y 1 add 2 div bpside mul cvi def
  623. X        xindex yindex bitison
  624. X        { /onbits onbits 1 add def 1 }
  625. X        { /offbits offbits 1 add def 0 }
  626. X        ifelse
  627. X        } setscreen
  628. X    {} settransfer
  629. X    offbits offbits onbits add div setgray
  630. X} def
  631. X
  632. X<d1e3c5885c3e1d88> 8 1 300 32 div setpattern
  633. X
  634. X5 cm 15 cm 4 cm 1.5 cm ellipse fill
  635. X
  636. X<3e418080e3140808> 8 1 300 32 div setpattern
  637. X
  638. X12 cm 22 cm moveto 14 cm 1 cm -6 cm rlineto -2 cm 0 rlineto closepath fill
  639. X
  640. X3 { copypage } repeat erasepage
  641. X
  642. X(demo finished) print flush
  643. X
  644. X
  645. X% ---- %
  646. X
  647. X??
  648. END_OF_FILE
  649. if test 4966 -ne `wc -c <'./pscript/demo.ps'`; then
  650.     echo shar: \"'./pscript/demo.ps'\" unpacked with wrong size!
  651. fi
  652. # end of './pscript/demo.ps'
  653. fi
  654. if test -f './pscript/floor.ps' -a "${1}" != "-c" ; then 
  655.   echo shar: Will not clobber existing file \"'./pscript/floor.ps'\"
  656. else
  657. echo shar: Extracting \"'./pscript/floor.ps'\" \(4398 characters\)
  658. sed "s/^X//" >'./pscript/floor.ps' <<'END_OF_FILE'
  659. X%!
  660. X% Machine room floorplan at UNSW
  661. X% 1 grid square is a floor tile on the false floor
  662. X
  663. X(floor starts\n) print flush
  664. X/a4
  665. X    [
  666. X        [ 300 72 div 0 0 -300 72 div -72 3436 ]
  667. X        292 3365
  668. X        {statusdict /jobstate (printing) put 0 setblink
  669. X        margins exch 142 add exch 256 add 8 div round cvi frametoroket
  670. X        statusdict /jobstate (busy) put
  671. X        1 setblink }
  672. X        /framedevice load
  673. X        60 45 {dup mul exch dup mul add 1.0 exch sub } /setscreen load
  674. X        {} /settransfer load
  675. X        /initgraphics load
  676. X        /erasepage load
  677. X    ] cvx
  678. statusdict begin bind end readonly def
  679. X
  680. a4
  681. X
  682. X/metre { 0.608 div } def
  683. X/neg { 0 exch sub } def
  684. X
  685. clippath pathbbox pop pop translate newpath
  686. clippath pathbbox newpath /ymax exch def /xmax exch def pop pop
  687. X/xlen 14 def
  688. X/ylen 30.5 def
  689. X
  690. ymax ylen 1 add div dup scale
  691. X2 setlinecap
  692. X0.01 setlinewidth
  693. X/boxfill 0.99 def    % 0 for black, 1 for white, in-between for grey
  694. X/textsize 0.2 def
  695. X/x0 0.5 def /y0 0.5 def
  696. X/xmax x0 xlen add def /ymax y0 ylen add def
  697. X/Times-Roman findfont textsize scalefont setfont
  698. X
  699. X/xline { currentpoint xlen 0 rlineto stroke moveto } def
  700. X/yline { currentpoint 0 ylen rlineto stroke moveto } def
  701. X/doorwid 0.71 metre def
  702. X
  703. X/room
  704. X{
  705. X    % label x axis
  706. X    1 1 14 {
  707. X        /x exch def
  708. X        x 0.05 sub 0.1 moveto x 2 string cvs show
  709. X        x 0.05 sub ymax 0.2 add moveto x 2 string cvs show
  710. X    } for
  711. X    % label y axis
  712. X    1 1 30 {
  713. X        /y exch def
  714. X        0.1 y 0.05 sub moveto y 2 string cvs show
  715. X        xmax 0.2 add y 0.05 sub moveto y 2 string cvs show
  716. X    } for
  717. X    % doors
  718. X    [ 0.1 0.1 ] 0 setdash
  719. X    xmax 13.1 moveto currentpoint doorwid 90 180 arc closepath stroke
  720. X    xmax 15.4 moveto currentpoint doorwid 180 270 arc closepath stroke
  721. X    xmax 22.6 moveto currentpoint doorwid 0 90 arc closepath stroke
  722. X    xmax 24.9 moveto currentpoint doorwid 270 360 arc closepath stroke
  723. X    [ ] 0 setdash
  724. X    % room boundary
  725. X    0.5 2 moveto
  726. X    5.6 2 lineto
  727. X    5.6 0.5 lineto
  728. X    xmax 0.5 lineto
  729. X    xmax ymax lineto
  730. X    1 ymax lineto 0 -0.5 rlineto -0.5 0 rlineto
  731. X    x0 21.1 lineto 0.5 0 rlineto 0 -0.7 rlineto -0.5 0 rlineto
  732. X    x0 12.3 lineto 0.5 0 rlineto 0 -2 rlineto -0.5 0 rlineto
  733. X    closepath
  734. X    gsave 0.1 setlinewidth stroke grestore
  735. X    clip
  736. X} def
  737. X
  738. X/grid
  739. X{
  740. X    gsave 0.01 setlinewidth
  741. X    1 y0 moveto
  742. X    14 { yline 1 0 rmoveto } repeat
  743. X    x0 1 moveto
  744. X    30 { xline 0 1 rmoveto } repeat
  745. X} def
  746. X
  747. X% arguments to box: rotation xpos ypos xlen ylen name
  748. X/box
  749. X{
  750. X    /name exch def
  751. X    /y exch def
  752. X    /x exch def
  753. X    gsave
  754. X    translate
  755. X    rotate
  756. X    newpath
  757. X    0 0 moveto
  758. X    x 0 lineto x y lineto 0 y lineto closepath
  759. X    % comment out next line to avoid filling boxes
  760. X    gsave boxfill setgray fill grestore % fill the box
  761. X    stroke    % draw outline
  762. X    name stringwidth y exch sub 2 div 0.05 sub /y exch def
  763. X        x exch sub 2 div y moveto
  764. X        name show
  765. X    grestore
  766. X} def
  767. X
  768. X/power1x10    % single 10-amp single phase
  769. X{
  770. X    /name exch def
  771. X    /l 0.2 def
  772. X    gsave translate
  773. X    0 l moveto
  774. X    0 0 moveto 0 l lineto l l lineto l 0 lineto closepath stroke
  775. X} def
  776. X
  777. X% arguments to furniture are:
  778. X% rotation xpos ypos
  779. X% (rotation 0 == front facing window; pos is front left corner)
  780. X/compactus { 5.3 1.5 (compactus) box } def
  781. X/modem { 1 1 (modem) box } def
  782. X/mss { 2 1 (MSS) box } def
  783. X/poweroutlet { /n exch def 0.3 0.2 n box } def
  784. X/vax750 { 1.3 1.3 (750) box } def
  785. X/karri { 2.2 1.3 (karri) box } def
  786. X/cdc { 1 1.5 (cdc) box } def
  787. X/rp04 { 1.3 1.3 (rp04) box } def
  788. X/elecvax { 5.3 1.3 (elecvax) box } def
  789. X/rp06 { 1.3 1.3 (rp06) box } def
  790. X/cheops { 1 1.8 (cheops) box } def
  791. X/rackwidth 0.9 def
  792. X/rackdepth 1.2 def
  793. X/rack { rackwidth rackdepth } def
  794. X/elec35 { rack (35) box } def
  795. X/dsl { rack (dsl) box } def
  796. X/rk07 { 0.9 1.2 (rk07) box } def
  797. X/cadvax { 4.2 1.3 (cadvax) box } def
  798. X/pdp { rackwidth 3 mul rackdepth 3 -1 roll box } def
  799. X/elec70a { (70a) pdp } def
  800. X/elec70b { (70b) pdp } def
  801. X
  802. X% fixed power conduits
  803. X/fixedconduit
  804. X{
  805. X    6.09 30.1 moveto 10 { 0 -8 rlineto 0.09 8 rmoveto } repeat stroke
  806. X} def
  807. X
  808. X/fixedoutlets
  809. X{
  810. X    0 4.3 16.3 (2) poweroutlet
  811. X} def
  812. X
  813. room grid
  814. X% fixed items
  815. X0 1 30.7 2 0.3 (power) box
  816. X-90 14.3 20.5 0.6 0.15 (telecom) box
  817. X-90 14.3 10.2 0.6 0.15 (thermo) box
  818. X0 9.5 29.6 modem
  819. X0 11.5 30 mss
  820. X90 2 3 compactus
  821. X% fixedoutlets
  822. X% movable items
  823. X90 5 4 rp04 90 5 5.3 rp04
  824. X90 5 7 cdc
  825. X90 5 9.4 elecvax
  826. X90 5 16.1 rp06 90 5 17.4 rp06 90 5 18.7 rp06
  827. X90 5 21 cheops
  828. X90 5 23.05 elec35
  829. X90 5 25.05 dsl
  830. X90 5 26 rk07 90 5 26.9 rk07 90 5 27.8 rk07 90 5 28.7 rk07
  831. X0 6.4 27 rp06 0 7.7 27 rp06
  832. X0 6.8 24 karri
  833. X-90 11 27.6 rp06 -90 11 26.3 rp06
  834. X-90 11 23.1 cadvax
  835. X-90 11 18 cdc
  836. X-90 11 17 rk07
  837. X-90 11 12 elec70b
  838. X-90 11 9.3 elec70a
  839. X
  840. X(floor finished\n) print flush
  841. X4 { copypage } repeat
  842. showpage
  843. END_OF_FILE
  844. if test 4398 -ne `wc -c <'./pscript/floor.ps'`; then
  845.     echo shar: \"'./pscript/floor.ps'\" unpacked with wrong size!
  846. fi
  847. # end of './pscript/floor.ps'
  848. fi
  849. if test -f './tpscript/devalw/PB' -a "${1}" != "-c" ; then 
  850.   echo shar: Will not clobber existing file \"'./tpscript/devalw/PB'\"
  851. else
  852. echo shar: Extracting \"'./tpscript/devalw/PB'\" \(2918 characters\)
  853. sed "s/^X//" >'./tpscript/devalw/PB' <<'END_OF_FILE'
  854. X# Palatino-Bold
  855. name PB
  856. internalname PalatinoB
  857. ligatures fi fl ff ffi ffl 0
  858. spacewidth 25
  859. charset
  860. X# 
  861. X# not yet updated
  862. X# 
  863. X!    28    2    041
  864. X"    37    2    042
  865. X#    61    2    043
  866. X$    50    3    044
  867. X%    84    2    045
  868. X&    78    2    046
  869. X'    28    2    047
  870. X(    33    3    050
  871. X)    33    3    051
  872. X*    39    2    052
  873. X+    61    0    053
  874. X,    25    1    054
  875. X-    33    0    055
  876. hy    "
  877. X.    25    0    056
  878. X/    61    2    057
  879. sl    "
  880. X0    50    2    060
  881. X1    50    2    061
  882. X2    50    2    062
  883. X3    50    2    063
  884. X4    50    2    064
  885. X5    50    2    065
  886. X6    50    2    066
  887. X7    50    2    067
  888. X8    50    2    070
  889. X9    50    2    071
  890. X:    25    0    072
  891. X;    25    1    073
  892. X<    61    0    074
  893. X=    61    0    075
  894. X>    61    0    076
  895. X?    40    2    077
  896. X@    75    3    0100
  897. A    78    2    0101
  898. B    61    2    0102
  899. C    71    2    0103
  900. D    77    2    0104
  901. E    61    2    0105
  902. XF    56    2    0106
  903. G    76    2    0107
  904. H    83    2    0110
  905. I    34    2    0111
  906. J    33    3    0112
  907. K    73    2    0113
  908. L    61    2    0114
  909. M    95    2    0115
  910. N    83    2    0116
  911. O    79    2    0117
  912. P    60    2    0120
  913. Q    79    3    0121
  914. R    67    2    0122
  915. S    53    2    0123
  916. T    61    2    0124
  917. U    78    2    0125
  918. V    72    2    0126
  919. W    100    2    0127
  920. XX    67    2    0130
  921. Y    67    2    0131
  922. Z    67    2    0132
  923. X[    33    3    0133
  924. X\    61    2    0134
  925. X]    33    3    0135
  926. a^    61    2    0136    asciicircum
  927. X_    50    1    0137
  928. ru    "
  929. X`    28    2    0140
  930. a    50    0    0141
  931. b    55    2    0142
  932. c    44    0    0143
  933. d    61    2    0144
  934. e    48    0    0145
  935. f    33    2    0146
  936. g    56    1    0147
  937. h    58    2    0150
  938. i    29    2    0151
  939. j    23    3    0152
  940. k    56    2    0153
  941. l    29    2    0154
  942. m    88    0    0155
  943. n    58    0    0156
  944. o    50    0    0157
  945. p    60    1    0160
  946. q    56    1    0161
  947. r    40    0    0162
  948. s    42    0    0163
  949. t    33    2    0164
  950. u    60    0    0165
  951. v    57    0    0166
  952. w    83    0    0167
  953. x    52    0    0170
  954. y    56    1    0171
  955. z    50    0    0172
  956. X{    33    3    0173
  957. X|    60    3    0174
  958. X}    33    3    0175
  959. a~    60    0    0176    asciitilde
  960. I!    28    3    0241    exclamdown
  961. ct    50    3    0242    cent
  962. po    50    2    0243    sterling
  963. X$J    50    2    0245    yen
  964. sc    50    3    0247    section
  965. fm    21    2    0251    quotesingle
  966. n'    "
  967. lq    50    2    0252    quotedblleft
  968. d<    50    0    0253    guillemotleft
  969. l<    33    0    0254    guilsinglleft
  970. r>    33    0    0255    guilsinglright
  971. fi    61    2    0256    fi
  972. fl    61    2    0257    fl
  973. X\-    50    0    0261    endash
  974. dg    50    3    0262    dagger
  975. dd    50    3    0263    daggerdbl
  976. pp    63    3    0266    paragraph
  977. bu    61    0    0267    bullet
  978. rq    50    2    0272    quotedblright
  979. d>    50    0    0273    guillemotright
  980. pm    114    2    0275    perthousand
  981. I?    40    1    0277    questiondown
  982. ga    33    2    0301    grave
  983. X\`    "
  984. aa    33    2    0302    acute
  985. X\'    "
  986. X^    33    2    0303    circumflex
  987. X~    33    2    0304    tilde
  988. ma    33    2    0305    macron
  989. be    33    2    0306    breve
  990. dt    25    2    0307    dotaccent
  991. X..    33    2    0310    dieresis
  992. um    "
  993. ri    33    2    0312    ring
  994. cd    33    1    0313    cedilla
  995. X''    38    2    0315    hungarumlaut
  996. og    31    1    0316    ogonek
  997. hc    33    2    0317    caron
  998. em    100    0    0320    emdash
  999. a:    50    2    0321    adieresis
  1000. o:    50    2    0322    odieresis
  1001. u:    60    2    0323    udieresis
  1002. A:    77    2    0324    Adieresis
  1003. O:    79    2    0325    Odieresis
  1004. U:    78    2    0326    Udieresis
  1005. AE    94    2    0341    AE
  1006. PL    61    2    0350    Lslash
  1007. O/    83    3    0351    Oslash
  1008. OE    100    2    0352    OE
  1009. ae    76    0    0361    ae
  1010. ui    29    0    0365    dotlessi
  1011. Pl    29    2    0370    lslash
  1012. o/    56    3    0371    oslash
  1013. oe    83    0    0372    oe
  1014. ss    56    2    0373    germandbls
  1015. X# rest not modified
  1016. ff    61    2    0100    ff ligature - faked
  1017. XFi    84    2    0100    Fi ligature - faked
  1018. XFl    84    2    0100    Fl ligature - faked
  1019. X12    67    2    0100    1/2 faked - code is irrelevent
  1020. X13    67    2    0100    1/3 faked - code is irrelevent
  1021. X14    67    2    0100    1/4 faked - code is irrelevent
  1022. X18    67    2    0100    1/8 faked - code is irrelevent
  1023. X23    67    2    0100    2/3 faked - code is irrelevent
  1024. X34    67    2    0100    3/4 faked - code is irrelevent
  1025. X38    67    2    0100    3/8 faked - code is irrelevent
  1026. X58    67    2    0100    5/8 faked - code is irrelevent
  1027. X78    67    2    0100    7/8 faked - code is irrelevent
  1028. sq    100    3    0100    square box
  1029. X
  1030. END_OF_FILE
  1031. if test 2918 -ne `wc -c <'./tpscript/devalw/PB'`; then
  1032.     echo shar: \"'./tpscript/devalw/PB'\" unpacked with wrong size!
  1033. fi
  1034. # end of './tpscript/devalw/PB'
  1035. fi
  1036. if test -f './tpscript/hash.c' -a "${1}" != "-c" ; then 
  1037.   echo shar: Will not clobber existing file \"'./tpscript/hash.c'\"
  1038. else
  1039. echo shar: Extracting \"'./tpscript/hash.c'\" \(4821 characters\)
  1040. sed "s/^X//" >'./tpscript/hash.c' <<'END_OF_FILE'
  1041. X#include    "tpscript.h"
  1042. X#include    "hash.h"
  1043. X
  1044. X/*
  1045. X * the non-acsii character names are now hashed and the elements of the
  1046. X * hash structure also contain information about whether this particular
  1047. X * character can be directly printed where troff thinks it is going
  1048. X * or whether it needs special massaging or even contruction from other
  1049. X * characters.
  1050. X */
  1051. X
  1052. X
  1053. HASH_ELEMENT    *hash_free = NOHASH,    /* points to next available entry */
  1054. X        *hash_tab[HASH_SIZE];    /* starting entries */
  1055. X
  1056. hash_init()
  1057. X{
  1058. X    register    SPECIAL_NAME    *snp;
  1059. X    register    HASH_ELEMENT    *hep, **hpp;
  1060. X    register    int        i;
  1061. X    char                *s;
  1062. X
  1063. X    hash_free = (HASH_ELEMENT *)emalloc( ncharname * sizeof(HASH_ELEMENT));
  1064. X
  1065. X    for( i = 0 ; i < ncharname ; i++ ) {
  1066. X        s = &charname[ chartab[ i ] ];
  1067. X        hpp = & hash_tab[ hash_it(s) ];
  1068. X            /*
  1069. X             * skip through the entries already with this hash value
  1070. X             */
  1071. X        while( *hpp != NOHASH )
  1072. X            hpp = &( (*hpp)->hash_next );
  1073. X        *hpp = hep = hash_free++;
  1074. X        hep->hash_next = NOHASH;
  1075. X        hep->hash_index = i;
  1076. X        hep->hash_special = NOSPECIAL;    /* assume nothing special */
  1077. X            /*
  1078. X             * now find if it is one of the special names
  1079. X             */
  1080. X        for ( snp = &specnames[0] ; snp->troff_name != NULL ; snp++ ) {
  1081. X            if ( strcmp( s, snp->troff_name ) == 0 ) {
  1082. X                hep->hash_special = snp;
  1083. X                break;
  1084. X            }
  1085. X        }
  1086. X    }
  1087. X
  1088. X}
  1089. X
  1090. dumphash( n )
  1091. X    int n;
  1092. X{
  1093. X    register    int i;
  1094. X
  1095. X    if ( n >= 0 && n < HASH_SIZE )
  1096. X        dhsh( n );
  1097. X    else
  1098. X        for ( i = 0 ; i < HASH_SIZE ; i++ )
  1099. X            dhsh( i );
  1100. X}
  1101. X
  1102. dhsh( i )
  1103. X    int    i;
  1104. X{
  1105. X    register    HASH_ELEMENT *hep;
  1106. X
  1107. X    hep = hash_tab[i];
  1108. X    fprintf( stderr, "hashed at %d:\n\t", i );
  1109. X    while ( hep != NOHASH )
  1110. X    {
  1111. X        fprintf( stderr, "%s ",
  1112. X            &( charname[ chartab[ hep->hash_index ] ] ));
  1113. X        hep = hep->hash_next;
  1114. X    }
  1115. X    fprintf( stderr, "\n" );
  1116. X}
  1117. X
  1118. X    /*
  1119. X     * hashing function
  1120. X     */
  1121. hash_it( s )
  1122. X    register    char    *s;
  1123. X{
  1124. X    register    int    i;
  1125. X
  1126. X    i = 0;
  1127. X    while( *s )
  1128. X        i += *s++;
  1129. X    return( i % HASH_SIZE );
  1130. X}
  1131. X
  1132. X
  1133. putspec(specstr)
  1134. char    *specstr;
  1135. X{
  1136. X    register HASH_ELEMENT        *hep;
  1137. X    register int            i = 0,
  1138. X                    n;
  1139. X    register struct fontdesc    *fd;
  1140. X
  1141. X    fd = tfp.fp_font;
  1142. X    for ( hep = hash_tab[ hash_it( specstr ) ] ; hep != NOHASH ; hep = hep->hash_next )
  1143. X    {
  1144. X        if ( strcmp ( specstr, &charname[ chartab[ hep->hash_index ] ] ) == 0 )
  1145. X            break;
  1146. X    }
  1147. X    if ( hep == NOHASH )
  1148. X    {
  1149. X        sprintf(errbuf, "special character '%s' unknown", specstr);
  1150. X        error(ERR_WARN, errbuf);
  1151. X        return;
  1152. X    }
  1153. X
  1154. X    i = hep->hash_index;
  1155. X    i += NASCPRINT;            /* skip ordinary chars */
  1156. X            /* check std font */
  1157. X    if((n = fd->f_fitab[i] & BMASK) != 0)
  1158. X        ;         /* ok - must be in current font */
  1159. X                /* otherwise check special font */
  1160. X    else if( (spcfnt1 != NOFONTDESC) && (n = spcfnt1->f_fitab[i] & BMASK) != 0)
  1161. X    {
  1162. X        fd = spcfnt1;
  1163. X    }
  1164. X                /* try the locally defined special font */
  1165. X    else if( (spcfnt2 != NOFONTDESC) && (n = spcfnt2->f_fitab[i] & BMASK) != 0)
  1166. X    {
  1167. X        fd = spcfnt2;
  1168. X    }
  1169. X    else
  1170. X    {
  1171. X        sprintf(errbuf,
  1172. X            "Special char '%s' not in current (%d) or special fonts\n",
  1173. X            specstr, currtfont);
  1174. X        error(ERR_WARN, errbuf);
  1175. X        return;
  1176. X    }
  1177. X    width_pending += GETWIDTH( fd, n );
  1178. X
  1179. X    if ( hep->hash_special != NOSPECIAL )
  1180. X    {
  1181. X        register    SPECIAL_NAME    *snp;
  1182. X
  1183. X        setfont( FALSE );    /* ensure size is setup */
  1184. X        CLOSEWORD();        /* may or may not have been done
  1185. X                    ** in setfont()
  1186. X                    */
  1187. X
  1188. X        snp = hep->hash_special;
  1189. X        if ( ( snp->sn_flags & SN_DEFINED ) == 0 )
  1190. X        {
  1191. X            snp->sn_flags |= SN_DEFINED;
  1192. X            fprintf( postr, "\n/C%s { %s } def\n",
  1193. X                snp->troff_name, snp->definition );
  1194. X            if ( snp->sn_flags & SN_ANY_MULTIPLE )
  1195. X                putmultdef( snp );
  1196. X#ifdef notdef
  1197. X            if ( snp->sn_flags & SN_FRACTION )
  1198. X                putfractdef( snp );
  1199. X            else if ( snp->sn_flags & SN_BRK_ROUNDING )
  1200. X                putbrackdef( snp );
  1201. X            else if ( snp->sn_flags & SN_BRACKET )
  1202. X                putbrackdef( snp );
  1203. X#endif
  1204. X        }
  1205. X        fprintf( postr, "\nC%s", snp->troff_name );
  1206. X        return;
  1207. X    }
  1208. X
  1209. X    if( fd != tfp.fp_font )
  1210. X    {
  1211. X        struct fontdesc    *font;
  1212. X
  1213. X        font = tfp.fp_font;
  1214. X        tfp.fp_font = fd;
  1215. X        putch(fd->f_codetab[n] & BMASK);
  1216. X        tfp.fp_font = font;
  1217. X    }
  1218. X    else
  1219. X    {
  1220. X        putch(fd->f_codetab[n] & BMASK );
  1221. X    }
  1222. X}
  1223. X
  1224. X    /*
  1225. X     * setup definition used in more than one special char
  1226. X     * - e.g. Cfrac used for \(12, \(14 etc
  1227. X     * first time through we scan through the special names list for
  1228. X     * a definition of the pseudo-name "fraction" which is used for the
  1229. X     * others
  1230. X     */
  1231. putmultdef( snp )
  1232. X    register    SPECIAL_NAME *snp;
  1233. X{
  1234. X    register    SPECIAL_NAME *mnp;
  1235. X    register    int    type;
  1236. X
  1237. X
  1238. X    type = snp->sn_flags & SN_ANY_MULTIPLE;
  1239. X
  1240. X    for ( mnp = &multdefs[0] ; mnp->troff_name != (char *)0 ; mnp++ ) {
  1241. X        if ( type == (mnp->sn_flags & SN_ANY_MULTIPLE ) )
  1242. X        {
  1243. X            if ( ( mnp->sn_flags & SN_DEFINED ) == 0 )
  1244. X            {
  1245. X                fprintf( postr, "\n/C%s{%s}def",
  1246. X                        mnp->troff_name, mnp->definition);
  1247. X                mnp->sn_flags |= SN_DEFINED;
  1248. X            }
  1249. X            break;
  1250. X        }
  1251. X    }
  1252. X}
  1253. X
  1254. X
  1255. resetspcl()
  1256. X{
  1257. X    register    SPECIAL_NAME    *snp;
  1258. X
  1259. X    for ( snp = &specnames[0] ; snp->troff_name != (char *)0 ; snp++ )
  1260. X        snp->sn_flags &= ~SN_DEFINED;
  1261. X    for ( snp = &multdefs[0] ; snp->troff_name != (char *)0 ; snp++ )
  1262. X        snp->sn_flags &= ~SN_DEFINED;
  1263. X}
  1264. END_OF_FILE
  1265. if test 4821 -ne `wc -c <'./tpscript/hash.c'`; then
  1266.     echo shar: \"'./tpscript/hash.c'\" unpacked with wrong size!
  1267. fi
  1268. # end of './tpscript/hash.c'
  1269. fi
  1270. if test -f './tpscript/sfont2defs.H' -a "${1}" != "-c" ; then 
  1271.   echo shar: Will not clobber existing file \"'./tpscript/sfont2defs.H'\"
  1272. else
  1273. echo shar: Extracting \"'./tpscript/sfont2defs.H'\" \(3557 characters\)
  1274. sed "s/^X//" >'./tpscript/sfont2defs.H' <<'END_OF_FILE'
  1275. X#    sfont2defs.H
  1276. X#    source file for definitions of special characters in the second
  1277. X#    locally-defined special font
  1278. X#    this file is processed by sed to produce sfont2defs.h
  1279. X#    syntax is:
  1280. X#    troff-name <white-space> { definition including optional comments
  1281. X#        terminated by "}" on a line of its own
  1282. X#        white space is minimised on output
  1283. X#    anything following `#' is ignored
  1284. X#    a line commencing with `#' is deleted
  1285. X#    as are blank lines
  1286. X#    note `\` should be escaped as "\\"
  1287. X
  1288. X
  1289. X#    The bracket end pieces just load the stack with values which are then
  1290. X#    used by the common procedure C.brk.end which does a
  1291. X#    moveto rlineto rcurveto (then back to the start and across by 60)
  1292. X#        rlineto rcurveto fill
  1293. X#    This is only done to save the output file size and to make it
  1294. X#    more confusing to interpret what is going on.
  1295. X#    Remember the stack is loaded last in first out
  1296. X
  1297. lt    {
  1298. X    0 150       50 210    140 250        # inside rcurve to just below tip
  1299. X    0 730
  1300. X    0 150       50 250    200 250        # outside rcurve to tip
  1301. X    0 750                # rline up
  1302. X    220 -250            # starting point
  1303. X    C.brk.end
  1304. X}
  1305. X
  1306. lb    {
  1307. X    0 -150       50 -210    140 -250    # inside rcurve to just below tip
  1308. X    0 -730
  1309. X    0 -150       50 -250    200 -250    # outside rcurve to tip
  1310. X    0 -750                # rline up
  1311. X    220 750            # starting point
  1312. X    C.brk.end
  1313. X}
  1314. X
  1315. lk    {
  1316. X    1 setlinewidth
  1317. X    220 -250 moveto
  1318. X    0 400 rlineto
  1319. X    0 50    -50 100     -100 100  rcurveto
  1320. X    50 0     100 50       100 100  rcurveto
  1321. X    0 400 rlineto
  1322. X    60 0 rlineto
  1323. X    0 -400 rlineto
  1324. X    0 -50    -50 -100     -100 -100  rcurveto
  1325. X    50 0     100 -50       100 -100  rcurveto
  1326. X    0 -400 rlineto
  1327. X    closepath fill
  1328. X}
  1329. X
  1330. rt    {
  1331. X    0 150       -50 250    -200 250    # outside rcurve to tip
  1332. X    0 750                # rline up
  1333. X    0 150       -50 210    -140 250    # inside rcurve to just below tip
  1334. X    0 730
  1335. X    220 -250            # starting point
  1336. X    C.brk.end
  1337. X}
  1338. X
  1339. rb    {
  1340. X    0 -150       -50 -250    -200 -250    # outside rcurve to tip
  1341. X    0 -750                # rline up
  1342. X    0 -150       -50 -210    -140 -250    # inside rcurve to just below tip
  1343. X    0 -730
  1344. X    220 750            # starting point
  1345. X    C.brk.end
  1346. X}
  1347. X
  1348. rk    {
  1349. X    1 setlinewidth
  1350. X    220 -250 moveto
  1351. X    0 400 rlineto
  1352. X    0 50    50 100       100 100  rcurveto
  1353. X    -50 0     -100 50     -100 100  rcurveto
  1354. X    0 400 rlineto
  1355. X    60 0 rlineto
  1356. X    0 -400 rlineto
  1357. X    0 -50    50 -100       100 -100  rcurveto
  1358. X    -50 0     -100 -50     -100 -100  rcurveto
  1359. X    0 -400 rlineto
  1360. X    fill
  1361. X}
  1362. X
  1363. X
  1364. X#        the floor and ceiling bracket parts are made up with two
  1365. X#        procedures defined within the context of the font:
  1366. X#            C.bv    which draws the bold vertical
  1367. X#            C.barc    which adds the horizontal piece to the ceiling;
  1368. X#                the X coord on the stack should be set to the
  1369. X#                left edge of where the bar is to be put
  1370. X#            C.barf    likewise for floor
  1371. X
  1372. lc    {
  1373. X    C.bv                # draw the bv part
  1374. X    280                 # move to bottom right edge of vert bar
  1375. X    C.barc                # and draw in horizontal bar
  1376. X}
  1377. X
  1378. lf    {
  1379. X    C.bv 280 C.barf
  1380. X}
  1381. X
  1382. rc    {
  1383. X    C.bv 40 C.barc
  1384. X}
  1385. X
  1386. rf    {
  1387. X    C.bv 40 C.barf
  1388. X}
  1389. X
  1390. br    {
  1391. X    40 C.setl
  1392. X    0 -250 moveto
  1393. X    0 1000 rlineto
  1394. X    stroke
  1395. X}
  1396. X
  1397. rn    {
  1398. X    40 C.setl
  1399. X    0 895 moveto
  1400. X    500 0 rlineto
  1401. X    stroke
  1402. X}
  1403. X
  1404. ci    {
  1405. X    40 C.setl
  1406. X    500 250                 # centre
  1407. X    400                    # radius
  1408. X    0 360 arc                # draw circle
  1409. X    stroke
  1410. X}
  1411. X
  1412. sp_6    {        # 1/6 em narrow space
  1413. X            # do nothing, the width is all that is needed
  1414. X}
  1415. X
  1416. sp_12    {        # 1/12 em narrow space
  1417. X            # null op
  1418. X}
  1419. X
  1420. r1    {        # reversible chemical reaction
  1421. X    40 C.setl
  1422. X    0 setlinejoin
  1423. X    700 180 moveto -650 currentlinewidth add 0 rlineto 200 -200 rlineto
  1424. X    50 360 moveto 650 currentlinewidth sub 0 rlineto -200 200 rlineto
  1425. X    stroke
  1426. X}
  1427. X
  1428. r2    {        # reversible reaction with full arrowheads
  1429. X    40 C.setl
  1430. X    2 setlinejoin
  1431. X    217 18 moveto
  1432. X                    # left arrowhead
  1433. X    -150 150 rlineto 150 150 rlineto -150 -150 rlineto
  1434. X    633 0 rlineto
  1435. X    50 360 moveto
  1436. X    633 0 rlineto
  1437. X    -150 150 rlineto 150 -150 rlineto -150 -150 rlineto
  1438. X    stroke
  1439. X}
  1440. END_OF_FILE
  1441. if test 3557 -ne `wc -c <'./tpscript/sfont2defs.H'`; then
  1442.     echo shar: \"'./tpscript/sfont2defs.H'\" unpacked with wrong size!
  1443. fi
  1444. # end of './tpscript/sfont2defs.H'
  1445. fi
  1446. if test -f './tpscript/spline.c' -a "${1}" != "-c" ; then 
  1447.   echo shar: Will not clobber existing file \"'./tpscript/spline.c'\"
  1448. else
  1449. echo shar: Extracting \"'./tpscript/spline.c'\" \(5159 characters\)
  1450. sed "s/^X//" >'./tpscript/spline.c' <<'END_OF_FILE'
  1451. X/*
  1452. X * spline.c
  1453. X * routine for converting troff's idea of splines into
  1454. X * the form that the postscript device can easily construct.
  1455. X * This means that the actual curves are not precisely those that would
  1456. X * be drawn on an other machine, but at least they fit the general
  1457. X * description and intention (see Pic manual, section 8).
  1458. X * The technique used here takes the starting point, the mid-points
  1459. X * of all intermediate lines, and the end point and uses these to construct
  1460. X * bezier spline fragments
  1461. X * If there are only two defining lines, i.e. two coordinate pairs, we have the
  1462. X * minimun requirements and use rcurveto from currentpoint to endpoint with
  1463. X * interpolation of the two midpoints of the lines as postcript's control
  1464. X * points.
  1465. X * With more than this we use several rcurveto instructions; the first and last
  1466. X * go from each end to the midpoint of the line second from each end, using
  1467. X * the midpoint and other end of the respective end lines as control points.
  1468. X * All other segments go from one midpoint to the next using the point where
  1469. X * the lines join for both control points
  1470. X *
  1471. X * It should be possible to get closer approximation by suitably chosing
  1472. X * control points at some other fraction of the way along the line,
  1473. X * rather than just taking mid- and endpoints. For example, the end
  1474. X * sections of multiple curves are not actually tangent at the mid-point
  1475. X * at the moment and are a bit lopsided.
  1476. X *
  1477. X */
  1478. X
  1479. X#include    "tpscript.h"
  1480. X
  1481. X#include    <ctype.h>
  1482. X
  1483. X#define        MAXLINE        512        /* max len of D~ input line */
  1484. X#define        MAXCOORD    50        /* max num x,y pairs */
  1485. X
  1486. X        /*
  1487. X         * coordinates of each defining point in units, relative
  1488. X         * to the starting point
  1489. X         * the rounding errors are not cumulative so I don't think
  1490. X         * it needs to be floating point
  1491. X         */
  1492. typedef    struct    {
  1493. X    int    x,
  1494. X        y;
  1495. X} COORD;
  1496. X
  1497. static    char    splineformat[] = "\n%d %d %d %d %d %d spln";
  1498. X
  1499. draw_spline( istr )
  1500. X    FILE    *istr;
  1501. X{
  1502. X    register    int    nnums;
  1503. X    register    char    *s;
  1504. X    register    COORD    *cp;
  1505. X    char    buf[MAXLINE];
  1506. X    COORD    coord[MAXCOORD],
  1507. X        current,
  1508. X        next;
  1509. X
  1510. X    fgets(buf, MAXLINE, istr);
  1511. X    s = buf;
  1512. X    cp = &coord[0];
  1513. X        /*
  1514. X         * scan the input line for an indeterminate number of dx,dy
  1515. X         * pairs - some compilers cark if given sscanf with lots of
  1516. X         * args
  1517. X         */
  1518. X    for( ; s < &buf[MAXLINE] && cp < &coord[MAXCOORD] ; cp++ )
  1519. X    {
  1520. X        while ( isspace( *s ) )
  1521. X            s++;
  1522. X        if ( *s == '\0' )
  1523. X            break;        /* done */
  1524. X        cp->x = atoi( s );
  1525. X        while ( ! isspace( *s ) )
  1526. X            s++;
  1527. X        while ( isspace( *s ) )
  1528. X            s++;
  1529. X        if ( *s == '\0' )
  1530. X            break;        /* done */
  1531. X        cp->y = atoi( s );
  1532. X        while ( ! isspace( *s ) )
  1533. X            s++;
  1534. X    }
  1535. X    nnums = cp - &coord[0];
  1536. X        /*
  1537. X         * now we go through and change all coordinate references to
  1538. X         * be relative to the starting point, rather than relative to
  1539. X         * each previous point - this assists conversion to postscript
  1540. X         * where each coordinate to an rcurveto is relative to the
  1541. X         * starting point (of each rcurveto)
  1542. X         * There is a bug in pic which only returns negatively
  1543. X         * one unit less than it went forward - this may lead to
  1544. X         * accumulating errors in a hideously complicated spline
  1545. X         * I dont want to *fix* pic in case that is only a fix(ughh)
  1546. X         * for a bug elsewhere
  1547. X         */
  1548. X    for ( cp = &coord[1] ; cp < &coord[nnums] ; cp++ )
  1549. X    {
  1550. X        if ( cp->x < 0 )
  1551. X            cp->x--;
  1552. X        cp->x += cp[-1].x;
  1553. X        if ( cp->y < 0 )
  1554. X            cp->y--;
  1555. X        cp->y += cp[-1].y;
  1556. X    }
  1557. X
  1558. X#ifdef    debug
  1559. X    fprintf( stderr, "spline with %d coords to ", nnums );
  1560. X    for ( cp = &coord[0] ; cp < &coord[nnums] ; cp++ )
  1561. X        fprintf( stderr, "%d %d, ", cp->x, cp->y );
  1562. X    putc( '\n', stderr);
  1563. X#endif
  1564. X
  1565. X    current.x = 0;
  1566. X    current.y = 0;
  1567. X        /*
  1568. X         * note: the starting point is always relative 0,0, and coord[0]
  1569. X         * is the other end of the first line
  1570. X         */
  1571. X    cp = &coord[0];
  1572. X    if ( nnums < 2 )
  1573. X    {
  1574. X        error( ERR_WARN, "Too few points in spline" );
  1575. X        return;
  1576. X    }
  1577. X    if ( nnums == 2 )
  1578. X    {
  1579. X            /*
  1580. X             * remember: the positive y direction in troff is
  1581. X             * negative in postscript
  1582. X             */
  1583. X        fprintf
  1584. X        (
  1585. X            postr, splineformat,
  1586. X            cp->x/2, -(cp->y/2),
  1587. X            (cp->x + coord[1].x)/2, -(cp->y + coord[1].y)/2,
  1588. X            coord[1].x, -(coord[1].y)
  1589. X        );
  1590. X        return;
  1591. X    }
  1592. X        /*
  1593. X         * next current point will be middle of second line
  1594. X         */
  1595. X    current.x = (cp->x + coord[1].x) / 2;
  1596. X    current.y = (cp->y + coord[1].y) / 2;
  1597. X    fprintf
  1598. X    (
  1599. X        postr, splineformat,
  1600. X        cp->x/2, -(cp->y/2),
  1601. X        cp->x, -(cp->y),
  1602. X        current.x, -current.y
  1603. X    );
  1604. X    cp++;
  1605. X    while( --nnums > 2 )
  1606. X    {
  1607. X            /*
  1608. X             * this defines the end of this curve section and the
  1609. X             * start of the following section ( relative to
  1610. X             * the starting point)
  1611. X             */
  1612. X        next.x = (cp->x + cp[1].x) / 2;
  1613. X        next.y = (cp->y + cp[1].y) / 2;
  1614. X            /*
  1615. X             * note that each rcurveto must be done relative to
  1616. X             * the new currentpoint, thus the input relative
  1617. X             * values need to be adjusted
  1618. X             */
  1619. X        fprintf
  1620. X        (
  1621. X            postr, splineformat,
  1622. X            cp->x - current.x, current.y - cp->y,
  1623. X            cp->x - current.x, current.y - cp->y,
  1624. X            next.x - current.x, current.y - next.y
  1625. X        );
  1626. X        cp++;
  1627. X        current = next;        /* set new current point */
  1628. X    }
  1629. X
  1630. X        /*
  1631. X         * finally we draw the last section
  1632. X         */
  1633. X    fprintf
  1634. X    (
  1635. X        postr, splineformat,
  1636. X        cp->x - current.x, current.y - cp->y,
  1637. X        (cp->x + cp[1].x)/2 - current.x,
  1638. X        current.y - (cp->y + cp[1].y)/2,
  1639. X        cp[1].x - current.x, current.y - cp[1].y
  1640. X    );
  1641. X    return;
  1642. X}
  1643. X
  1644. END_OF_FILE
  1645. if test 5159 -ne `wc -c <'./tpscript/spline.c'`; then
  1646.     echo shar: \"'./tpscript/spline.c'\" unpacked with wrong size!
  1647. fi
  1648. # end of './tpscript/spline.c'
  1649. fi
  1650. if test -f './tpscript/tpscript.h' -a "${1}" != "-c" ; then 
  1651.   echo shar: Will not clobber existing file \"'./tpscript/tpscript.h'\"
  1652. else
  1653. echo shar: Extracting \"'./tpscript/tpscript.h'\" \(3837 characters\)
  1654. sed "s/^X//" >'./tpscript/tpscript.h' <<'END_OF_FILE'
  1655. X/*
  1656. X *    tpscript.h
  1657. X *    header definitions for tpscript.c:
  1658. X *        Troff post-processor for postscript devices
  1659. X */
  1660. X
  1661. X#include    <stdio.h>
  1662. X#include    "dev.h"
  1663. X#include    "pscript.h"
  1664. X
  1665. X#define    ERR_WARN    1    /* an input error - continue processing */
  1666. X#define    ERR_FATAL    2    /* an input error - abort processing */
  1667. X#define    ERR_SNARK    3    /* a program error - abort processing */
  1668. X#define    UNDEFINED    -1
  1669. X
  1670. X#define    BMASK        0xFF    /* low order byte */
  1671. X
  1672. X#define    NASCII        128    /* no. ascii characters */
  1673. X#define    NUNPRINT    32    /* no. unprintable characters */
  1674. X#define    NASCPRINT    (NASCII-NUNPRINT)    /* no. printable ascii chars */
  1675. X#define    MAXCHARS    255    /* max no. character codes */
  1676. X
  1677. X#define    DEF_FONT    1    /* default initial font */
  1678. X#define DEF_SIZE    10    /* default initial point size */
  1679. X#define    DEF_DEV        "alw"    /* default device - apple laser-writer */
  1680. X
  1681. extern int    errno;
  1682. extern char    *sys_errlist[];
  1683. X
  1684. extern    FILE    *Debug ;
  1685. extern    char    *ifile;        /* current input file name */
  1686. extern    int    lineno,            /* line no. in current input file */
  1687. X    npages;            /* no. pages printed so far */
  1688. extern    char    device[100],
  1689. X    errbuf[100];        /* tmp buffer for error messages */
  1690. extern    int
  1691. X    hpos,        /* current horizontal position */
  1692. X    vpos;        /* current vertical position (rel. TOP pg.) */
  1693. extern    int    
  1694. X    res,        /* resolution in THINGS/inch */
  1695. X    hor_res,        /* min horizontal movement (in THINGS) */
  1696. X    vert_res,        /* min vertical movement (in THINGS) */
  1697. X    respunits;
  1698. float     rotation;        /* page orientation (degrees) */
  1699. extern    int    currtfont,    /* current font number selected by troff */
  1700. X    papertype;         /* paper type (different imageable regions) */
  1701. X
  1702. X/* font parameters */
  1703. struct    fontparam {
  1704. X    int    fp_size;    /* character point size */
  1705. X    float    fp_height,    /* character height (points) */
  1706. X        fp_slant;    /* character slant (degrees) */
  1707. X    struct fontdesc *
  1708. X        fp_font;    /* font style */
  1709. X};
  1710. extern    struct    fontparam
  1711. X    tfp,        /* current troff font parameters */
  1712. X    pfp;        /* current postscript font parameters */
  1713. X
  1714. X#define    NOFONTDESC    ((struct fontdesc *)NULL )
  1715. X
  1716. X/* table of font descriptions */
  1717. struct fontdesc {
  1718. X    char    *f_intname;    /* postscript name */
  1719. X    char    *f_extname;    /* troff name */
  1720. X    int    f_nent;        /* no. entries for this font */
  1721. X    char    *f_widthtab;    /* character width tables */
  1722. X    char    *f_codetab;    /* code table for this font */
  1723. X    char    *f_fitab;    /* font index for this font */
  1724. X    bool    f_mounted;    /* whether font is mounted or not */
  1725. X};
  1726. X
  1727. extern struct fontdesc    *fontd,
  1728. X            *spcfnt1,    /* special font */
  1729. X            *spcfnt2;    /* special font 2 */
  1730. X
  1731. X/* font mount table - array of pointers to font descriptions */
  1732. extern    struct fontdesc    **fontmount;
  1733. X
  1734. X/* mapping between troff font names and builtin font names
  1735. X * This should go in the internal name part of the font description
  1736. X * itself, but there is only 10 bytes allocated (see dev.h).
  1737. X */
  1738. struct fontmap {
  1739. X    char    *fm_extname;    /* Troff font name */
  1740. X    char    *fm_intname;    /* Postscript font name */
  1741. X};
  1742. extern    struct    fontmap fontmap[];
  1743. X
  1744. X#define    NFONT    (sizeof(fontmap)/sizeof(fontmap[0]))
  1745. X
  1746. extern    struct dev    dev;
  1747. X
  1748. extern    short    *chartab;    /* char's index in charname array */
  1749. extern    char    *charname;    /* special character names */
  1750. extern    int    ncharname;        /* no. special character names */
  1751. extern    int    nfonts;        /* no. of fonts mounted */
  1752. extern    int    nfontmount;        /* no. of font mount positions */
  1753. X
  1754. X
  1755. X#define    GETWIDTH(fdp, index)    \
  1756. X  ((tfp.fp_size * ((fdp)->f_widthtab[ (index) ] & BMASK) + (respunits>>1)) / respunits)
  1757. X
  1758. X    /*
  1759. X     * this is the width that the printer will have moved following
  1760. X     * the last printed character, if troff then says to move a
  1761. X     * different amount we will shift the difference
  1762. X     */
  1763. extern    int    width_pending;
  1764. X
  1765. extern    bool    word_started;    /* we are in middle of word string */
  1766. X
  1767. X#define    CLOSEWORD()    {if ( word_started == TRUE ) {    \
  1768. X                fputs( ")s", postr );    \
  1769. X                word_started = FALSE;    \
  1770. X                }            \
  1771. X            }
  1772. X
  1773. X
  1774. extern    int        strcmp();
  1775. extern    char        *emalloc();
  1776. extern    struct fontdesc *findfont();
  1777. extern    struct fontmap    *getfmap();
  1778. X
  1779. END_OF_FILE
  1780. if test 3837 -ne `wc -c <'./tpscript/tpscript.h'`; then
  1781.     echo shar: \"'./tpscript/tpscript.h'\" unpacked with wrong size!
  1782. fi
  1783. # end of './tpscript/tpscript.h'
  1784. fi
  1785. echo shar: End of archive 3 \(of 5\).
  1786. cp /dev/null ark3isdone
  1787. MISSING=""
  1788. for I in 1 2 3 4 5 ; do
  1789.     if test ! -f ark${I}isdone ; then
  1790.     MISSING="${MISSING} ${I}"
  1791.     fi
  1792. done
  1793. if test "${MISSING}" = "" ; then
  1794.     echo You have unpacked all 5 archives.
  1795.     rm -f ark[1-9]isdone
  1796. else
  1797.     echo You still need to unpack the following archives:
  1798.     echo "        " ${MISSING}
  1799. fi
  1800. ##  End of shell archive.
  1801. exit 0
  1802.